//Create TestView
function TestView() {
	var self = Titanium.UI.createWindow({
        backgroundColor: 'black',
        fullscreen: true
    });    
    
    var PKTextField = require('view/PickerTextField');
    var myTable = Ti.UI.createTableView();
    myTable.separatorColor = 'transparent';
    myTable.top = 0;
    myTable.backgroundColor = 'transparent';
    self.add(myTable);
    
    var header1 = Titanium.UI.createView({
        backgroundColor: 'transparent',
        height: 5
    });
    var footer1 = Titanium.UI.createView({
        backgroundColor: 'transparent',
        height: 5
    });    
    
    var section1 = Ti.UI.createTableViewSection({
        height: 'auto',
        headerView:header1,
        footerView:footer1,
        backgroundColor:'transparent'
    });    
    
    var rowHeader = Ti.UI.createTableViewRow({
        height: 'auto',
        backgroundColor: 'transparent',
        borderColor: 'transparent'
    });
    
    section1.add(rowHeader);
    
    var row6 = Ti.UI.createTableViewRow({
        height: 'auto',
        backgroundColor: 'transparent',
        borderColor: 'transparent'
    });
    
    // Create a Button.
    var btnTest1 = Ti.UI.createButton({
        title : 'btnTest1',
        height : 'auto',
        width : 'auto',
        top : 5,
        left : 5
    });
    
    // Listen for click events.
    btnTest1.addEventListener('click', function() {
        alert('\'btnTest1\' was clicked!');
    });
    
    // Add to the parent view.
    row6.add(btnTest1);
    
    // Create a Button.
    var btnTest2 = Ti.UI.createButton({
        title : 'btnTest2',
        height : 'auto',
        width : 'auto',
        top : 5,
        right : 5
    });
    
    // Listen for click events.
    btnTest2.addEventListener('click', function() {
        alert('\'btnTest2\' was clicked!');
    });
    
    // Add to the parent view.
    row6.add(btnTest2);
    
    
    // Create a Button.
    var btntest3 = Ti.UI.createButton({
        title : 'btntest3',
        top : 5
    });
    
    // Listen for click events.
    btntest3.addEventListener('click', function() {
        alert('\'btntest3\' was clicked!');
    });
    
    // Add to the parent view.
    row6.add(btntest3);
    
    
    
    section1.add(row6);	
    
    
    
    
    var section2 = Ti.UI.createTableViewSection({
        height: 'auto'
    });
    for (var i=0; i < 20; i++) {
      section2.add(Ti.UI.createTableViewRow({
        title: 'title ' + (i +1),
        color: 'white'
    }));
    };

    var functionTitles = ['Property Rental: Fixed Rent', 'Main Func2', 'Sale & Purchase of Property', 'Sale & Purchase of Property', 'Mortgage', 'Home'];
    var functionIds = [1, 2, 3, 4, 5, 6];
    var pkSelectData = new Array();
    for (var i=0; i < functionTitles.length; i++) {
      pkSelectData[i] = {title: functionTitles[i], valueId: functionIds[i]};
      Ti.API.info('insert: ' + functionTitles[i] + '-->' + functionIds[i]);
    };
    var pkTextField = new PKTextField(self, 1, pkSelectData);
    var tabledata = new Array();
    tabledata[0] = rowHeader;
    
    rowHeader.add(pkTextField);
    myTable.setData([section1, section2]);
    
    
    
	return self;
}
module.exports = TestView;